<?

class mongo_eval_task extends system_task
{
	public function execute( array $params = array() )
	{
		$collection = array_shift($params);
		$db = explode('.', $collection);
		
		$operation = array_shift($params);

		switch ($operation)
		{
			case 'index':
				foreach ( $params as $column )
				{
					$c = explode(':', $column);
					$indexes[$c[0]] = $c[1];
				}

				db_mongo::col($db[0], $db[1])->ensureIndex($indexes);
				
				break;
		}
	}
}